import request from '@/config/axios'

export interface WeWorkB2CVO {
  pageNo: number,
  pageSize: number,
  name?: string,
  guid?: string,
  appKey?: string,
  appSecret?: string,
  url?: string,
  createTime?: string[],
  ownerId?: number,
}

// 获得企业微信_b2c
export const getWeWorkB2C = (id: string) => {
  return request.get({ url: '/ai/wework/get?id=' + id })
}

// 获得企业微信_b2c分页
export const getWeWorkB2CPage = (params: WeWorkB2CVO) => {
  return request.get({ url: '/ai/wework/page', params })
}

// 创建企业微信_b2c,callback参数 没修改就不要传
export const createWeWorkB2C = (data: any) => {
  return request.post({ url: '/ai/wework/create', data })
}

// 更新企业微信_b2c，callback参数 没修改就不要传
export const updateWeWorkB2C = (data: any) => {
  return request.put({ url: '/ai/wework/update', data })
}

// 删除企业微信_b2c
export const deleteWeWorkB2C = (id: string) => {
  return request.delete({ url: '/ai/wework/delete?id=' + id })
}

// 绑定到C端用户
export const bindUser = (data: any) => {
  return request.post({ url: '/ai/wework/bindUser', data })
}

// 导出企业微信_b2c Excel
export const exportExcel = (params: any) => {
  return request.download({ url: '/ai/wework/export-excel', params })
}

// 解绑用户(同时解绑智能体)
export const unbindUser = (weworkId: string) => {
  return request.delete({ url: '/ai/wework/unbindUser?weworkId=' + weworkId })
}